var express = require('express');
var router = express.Router();

var sql = require('../sql/index');
var Banner = require('./../sql/col/Banner')
/**
 * @api {get} /api/banner 获取轮播图数据
 * @apiName GetApiBanner
 * @apiGroup banner
 * 
 * @apiSuccess {json} Success-Response:
 *  res.send({
      code: '200',
      message: '获取轮播图数据',
      data
    })
 * @apiSampleRequest /api/banner
 * @apiVersion 0.0.0
 */
router.get('/', function(req,res, next) {
    sql.find(Banner, {}, { _id: 0 }).then(data => {
        res.send({
          code: '200',
          message: '获取轮播图数据',
          data
        })
    })
});


module.exports = router;